<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <!--
        =================================================
        * 页面名称: 加载页模板
        * 文件路径: loading.html
        * 作者: 孤山寺北
        * 邮箱: 3150675236@qq.com
        * 网站: https://www.gsav.cn
        * 创建日期: 2025-7-3
        * 最后更新: 2025-7-3
        * 版本: v1.0.0
        * 版权声明: Copyright (c) 2025 GSAV.CN . 保留所有权利。
        * 许可证: MIT License
        * 描述: 加载模板
        =================================================
    -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>加载中...</title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap">
    <style>
        :root {
            --primary: #3b82f6;
            --text: #1f2937;
            --text-light: #6b7280;
            --border: #e5e7eb;
            --radius: 8px;
            --space: 24px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
            background-color: #ffffff;
            color: var(--text);
            line-height: 1.5;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding: var(--space);
        }

        .loading-container {
            max-width: 480px;
            margin: auto;
            text-align: center;
        }

        .loading-spinner {
            width: 60px;
            height: 60px;
            margin: 0 auto var(--space);
            position: relative;
        }

        .spinner-circle {
            position: absolute;
            width: 100%;
            height: 100%;
            border: 3px solid rgba(59, 130, 246, 0.2);
            border-radius: 50%;
            border-top-color: var(--primary);
            animation: spin 1s linear infinite;
        }

        .loading-text {
            font-size: 1rem;
            color: var(--text-light);
            margin-bottom: var(--space);
        }

        .progress-text {
            font-size: 0.875rem;
            color: var(--text-light);
            margin-bottom: var(--space);
        }

        .cancel-btn {
            padding: 8px 16px;
            border-radius: var(--radius);
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid var(--border);
            background-color: white;
            color: var(--text-light);
        }

        .cancel-btn:hover {
            background-color: #f9fafb;
            color: var(--text);
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body>
    <div class="loading-container">
        <div class="loading-spinner">
            <div class="spinner-circle"></div>
        </div>
        
        <div class="loading-text">正在加载中，请稍候...</div>
        <div class="progress-text" id="progressText"></div>
        
        <button class="cancel-btn" id="cancelLoadingBtn">取消操作</button>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 模拟进度更新
            let progress = 0;
            const progressText = document.getElementById('progressText');
            const interval = setInterval(() => {
                progress += Math.random() * 10;
                if (progress >= 100) {
                    progress = 100;
                    clearInterval(interval);
                    // 自动跳转，该干啥自己写
                }
                progressText.textContent = `已完成 ${Math.min(progress, 100).toFixed(0)}%`;
            }, 500);
            
            // 取消按钮
            document.getElementById('cancelLoadingBtn').addEventListener('click', function() {
                clearInterval(interval);
                window.location.href = '/'; // 取消后返回首页
            });
        });
    </script>
</body>
</html>